package com.che.software.testato.domain.dao;

import java.util.List;

import com.che.software.testato.domain.dao.jdbc.exception.MatrixResultCreationDAOException;
import com.che.software.testato.domain.dao.jdbc.exception.MatrixResultSearchDAOException;
import com.che.software.testato.domain.dao.jdbc.exception.MatrixResultUpdateDAOException;
import com.che.software.testato.domain.entity.MatrixResult;
import com.che.software.testato.domain.entity.search.MatrixResultSearch;

/**
 * DAO interface dedicated to the matrix results management.
 * 
 * @author Clement HELIOU (clement.heliou@che-software.com).
 * @copyright Che Software.
 * @license GNU General Public License.
 * @since August, 2011.
 * 
 *        This file is part of Testato.
 * 
 *        Testato is free software: you can redistribute it and/or modify it
 *        under the terms of the GNU General Public License as published by the
 *        Free Software Foundation, either version 3 of the License, or (at your
 *        option) any later version.
 * 
 *        Testato is distributed in the hope that it will be useful, but WITHOUT
 *        ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *        FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 *        for more details.
 * 
 *        You should have received a copy of the GNU General Public License
 *        along with Testato. If not, see <http://www.gnu.org/licenses/>.
 * 
 *        Testato's logo is a creation of Arrioch
 *        (http://arrioch.deviantart.com/) and it's distributed under the terms
 *        of the Creative Commons License.
 */
public interface IMatrixResultDAO {

	/**
	 * Creates the matrix results for a given iteration assignment. The related
	 * matrix must be completed before calling this method.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @param iterationId the given iteration id.
	 * @since August, 2011.
	 * @throws MatrixResultCreationDAOException if an error occurs during the
	 *         creation.
	 */
	public void createMatrixResults(int iterationId) throws MatrixResultCreationDAOException;

	/**
	 * Matrix result search from a bean of criterions.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @param searchBean the criterions to use for the search.
	 * @return the resulting object list.
	 * @since August, 2011.
	 * @throws MatrixResultSearchDAOException if an error occurs during the
	 *         search.
	 */
	public List<MatrixResult> searchMatrixResult(MatrixResultSearch searchBean) throws MatrixResultSearchDAOException;

	/**
	 * Updates a matrix result from his object.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @param matrixResultToUpdate the matrix result object to update in the
	 *        database.
	 * @since August, 2011.
	 * @throws MatrixResultUpdateDAOException if an error occurs during the
	 *         update.
	 */
	public void updateMatrixResult(MatrixResult matrixResultToUpdate) throws MatrixResultUpdateDAOException;
}